#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int a[200];

int main()
{
    int n;
    cin>>n;
    for(int i=n;i>=0;--i)
    {
        cin>>a[i];

    }

    if(n==0) cout<<a[n];

    else
    {
        for(int i=n;i>=0;--i)
    {
        if(a[i]!=0)

        {if(i==n)
          {
            if(a[i]>1) cout<<a[i]<<"x^"<<i;
             else if(a[i]==1) cout<<"x^"<<i;
             else if(a[i]<-1) cout<<a[i]<<"x^"<<i;
             else if(a[i]==-1) cout<<"-"<<"x^"<<i;
          }
          else if(i==1)
          {
             if(a[i]>1) cout<<"+"<<a[i]<<"x";
             else if(a[i]==1) cout<<"+"<<"x";
             else if(a[i]<-1) cout<<a[i]<<"x";
             else if(a[i]==-1) cout<<"-"<<"x";
          }
          else if(i==0)
          {
              if(a[i]>0) cout<<"+"<<a[i];

             else if(a[i]<0) cout<<a[i];

          }
          else
          {
              if(a[i]>1) cout<<"+"<<a[i]<<"x^"<<i;
             else if(a[i]==1) cout<<"+"<<"x^"<<i;
             else if(a[i]<-1) cout<<a[i]<<"x^"<<i;
             else if(a[i]==-1) cout<<"-"<<"x^"<<i;
          }



        }

    }

    }

    return 0;
}
